<template>
  <div class="antv-chart-mini">
    <div class="chart-wrapper" :style="{ height: 46 }">
      <v-chart :force-fit="true" :height="height" :data="data" :padding="[36, 5, 18, 5]">
        <v-tooltip />
        <v-bar position="month*count" />
      </v-chart>
    </div>
  </div>
</template>

<script>
import moment from 'moment'
const data = []
const beginDay = new Date().getTime()
  data.push({
    month: '一月',
    count: Math.round(Math.random() * 10)
  })
data.push({
  month: '二月',
  count: Math.round(Math.random() * 10)
})


const tooltip = [
  'month*count',
  (month, count) => ({
    name: month,
    value: count
  })
]

const scale = [{
  dataKey: 'month',
  title: '月份',
  min: 2
}, {
  dataKey: 'count',
  title: '会员数量',
  min: 1,
  max: 30
}]

export default {
  name: 'MiniBar',
  data () {
    return {
      data,
      tooltip,
      scale,
      height: 100
    }
  }
}
</script>

<style lang="less" scoped>
  @import "chart";
</style>
